package com.lunar.controller;

import com.lunar.entity.PostInfo;
import com.lunar.service.PostInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class PostInfoController {

    @Autowired
    private PostInfoService postInfoService;

    @RequestMapping("/getAll")
    public List<PostInfo> getAll(){
        return postInfoService.getAll();
    }

    @PostMapping("upadte")
    public int update(PostInfo postInfo){
        return postInfoService.update(postInfo);
    }
}
